

alter PROCEDURE [dbo].[spx_get_promo] 
@sid uniqueidentifier,
@xml xml output
AS
BEGIN
	set nocount on;
	

set @xml = (
select p.id, p.title, p.info, replace(p.dt_beg,'T',' ') as dt
 from dbdata.dbo.promos p 
  for xml raw('promo'), root('root'), type
);

end;
go
/*
DECLARE	@return_value int,
		@xml xml

EXEC	@return_value = [dbo].[spx_get_promo]
		@sid = '3C2FF45D-DB15-4DDF-A205-02F43251A6C8',
		@xml = @xml OUTPUT

SELECT	@xml as N'@xml'

SELECT	'Return Value' = @return_value
*/

